/*
 * dc_analysis.h
 * shaomin.shi@
 * gip - happyelements.com
 */

#ifndef DC_ANALYSIS_H_
#define DC_ANALYSIS_H_

#define SUCCESS  200
#define MAX_STEP 960
#define MAX_LINE_SIZE 1024
#define MAX_SECTION_SIZE 120

/*Length of The Array */
#define _DAY  1
#define _HOUR 24
#define _MINUTE 1440
#define MAX_GAME_NUM 100

/*ASCII*/
#define SELECT_DAY 100
#define SELECT_HOUR 104
#define SELECT_MINUTE 109

/*LOG FILE INDEX*/
#define LOG_TIME_INDEX 		1
#define PLATFORM_INDEX 		2
#define GAME_NAME_INDEX 	3
#define SETP_INDEX 			4
#define GIP_USER_ID_INDEX 	5
#define IP_INDEX 			6
#define INTERVAL_INDEX 		7

/*each line of the log file*/
struct s_dc_log{
	char *log_time;
	int  platform;
	char *game_name;
	int  step;
	char *gip_user_id;
} log_struct;

/*result*/
struct s_dc_result{
	unsigned int step[MAX_STEP];
	unsigned int num;
} log_result[MAX_GAME_NUM];

/*game infomation*/
struct game{
	unsigned int game_index;
	char *game_name;
}game_data[MAX_GAME_NUM];

void parse_log_line(char *str_line);
char *substring(char *dst,char *src,int len,int start);
int get_game_index(char *game_name);

#endif /* DC_ANALYSIS_H_ */
